//
//  CustomerInfoViewController.m
//  mendianjieke
//
//  Created by 响当当 on 7/31/19.
//  Copyright © 2019 dongzheng. All rights reserved.
//

#import "CustomerInfoViewController.h"
#import "CustomerInfoView.h"

@interface CustomerInfoViewController ()
@property (nonatomic, strong)CustomerInfoView *infoView;
@end

@implementation CustomerInfoViewController

- (CustomerInfoView *)infoView
{
    if (!_infoView)
    {
        _infoView = [[CustomerInfoView alloc]initWithFrame:CGRectMake(0,NAVIBAR_HEIGHT,SCREEN_WIDTH,SCREEN_HEIGHT-NAVIBAR_HEIGHT)];
    }
    return _infoView;
}

- (void)viewDidLoad {
    [super viewDidLoad];
    
    [self setDefaultNavWithTitle:@"查看攻略"];
    
    [self.view addSubview:self.infoView];
    
    [self getinfo];
    [self getCustomerInfo];
}

- (void)getinfo
{
    
    NSDictionary *pramaters = @{
                                @"id" : self.customerID
                                };
    
    WeakSelf(self)
    [infoManager getCustomerInfo:pramaters sucess:^(id  _Nonnull acceptData) {
        [weakSelf.infoView getInfo:acceptData];
    } fail:^(NSError * _Nullable error) {
        
    }];
}

- (void)getCustomerInfo
{
    
    NSDictionary *pramaters = @{
                                @"id" : self.customerID
                                };
    
    WeakSelf(self)
    [infoManager getCustomerAttackInfo:pramaters sucess:^(id  _Nonnull acceptData) {
        [weakSelf.infoView customerAttack:acceptData];
    } fail:^(NSError * _Nullable error) {
        
    }];
}
@end
